/**
 * Mise en oeuvre de Pion.h
 *
 * @file Pion.cxx
 */

// A besoin de la declaration de la classe
#include "Pion.h"
#include <iostream>
#include <cstdlib>

using namespace std;

Pion::Pion()
{
	//cout << "Pion() - " << this << endl;
}

Pion::~Pion()
{
	//cout << "~Pion() - " << this << endl;
}

bool Pion::mouvementValide(Echiquier *e, int x, int y)
{
	if ( ! this->mouvementAutorise(e, x, y))
		return false;

	if (this->isWhite())
		return (y == this->y() + 1) && (abs(this->x() - x) <= 1);

	return (y == this->y() - 1) && (abs(this->x() - x) <= 1);
}
